Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(native): missing pointerId in pointer events #3347

Merged

Conversation

moose96
Copy link
Contributor

@moose96 moose96 commented Sep 6, 2024

Fixes issue related to @react-three/drei repository: #2067.

Analysis and explanation

The problem exists in handleTouchMoveDolly method of OrbitControls class in three-stdlib. dollyDelta.y value is NaN, because dollyStart.y and dollyEnd.y in dollyEnd.y / dollyStart.y are 0. It happens because of getSecondPointerPosition function which uses event.pointerId to identify pointers in arrays. Because event.pointerId is missing the method always returns the same pointer position, giving zero in the next calculations.

Please also look at removePointer and trackPointer methods above - they use event.pointerId as well.

Copy link

codesandbox-ci bot commented Sep 6, 2024

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit b26042d:

Sandbox Source
example Configuration

@CodyJasonBennett
Copy link
Member

Incredible find and breakdown. This might also help #3315.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants